package com.ltkj.shop.service.impl;

import java.util.List;
import com.ltkj.common.core.utils.DateUtils;
import com.ltkj.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ltkj.shop.mapper.ShopHotelRoomTypeMapper;
import com.ltkj.shop.domain.ShopHotelRoomType;
import com.ltkj.shop.service.IShopHotelRoomTypeService;

/**
 * 酒店房间类型Service业务层处理
 * 
 * @author xupf
 * @date 2023-10-07
 */
@Service
public class ShopHotelRoomTypeServiceImpl implements IShopHotelRoomTypeService 
{
    @Autowired
    private ShopHotelRoomTypeMapper shopHotelRoomTypeMapper;

    /**
     * 查询酒店房间类型
     * 
     * @param id 酒店房间类型主键
     * @return 酒店房间类型
     */
    @Override
    public ShopHotelRoomType selectShopHotelRoomTypeById(Long id)
    {
        return shopHotelRoomTypeMapper.selectShopHotelRoomTypeById(id);
    }

    /**
     * 查询酒店房间类型列表
     * 
     * @param shopHotelRoomType 酒店房间类型
     * @return 酒店房间类型
     */
    @Override
    public List<ShopHotelRoomType> selectShopHotelRoomTypeList(ShopHotelRoomType shopHotelRoomType)
    {
        return shopHotelRoomTypeMapper.selectShopHotelRoomTypeList(shopHotelRoomType);
    }

    /**
     * 新增酒店房间类型
     * 
     * @param shopHotelRoomType 酒店房间类型
     * @return 结果
     */
    @Override
    public int insertShopHotelRoomType(ShopHotelRoomType shopHotelRoomType)
    {
        shopHotelRoomType.setCreateBy(SecurityUtils.getLoginUser().getUsername());
        shopHotelRoomType.setCreateTime(DateUtils.getNowDate());
        return shopHotelRoomTypeMapper.insertShopHotelRoomType(shopHotelRoomType);
    }

    /**
     * 修改酒店房间类型
     * 
     * @param shopHotelRoomType 酒店房间类型
     * @return 结果
     */
    @Override
    public int updateShopHotelRoomType(ShopHotelRoomType shopHotelRoomType)
    {
        shopHotelRoomType.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
        shopHotelRoomType.setUpdateTime(DateUtils.getNowDate());
        return shopHotelRoomTypeMapper.updateShopHotelRoomType(shopHotelRoomType);
    }

    /**
     * 批量删除酒店房间类型
     * 
     * @param ids 需要删除的酒店房间类型主键
     * @return 结果
     */
    @Override
    public int deleteShopHotelRoomTypeByIds(Long[] ids)
    {
        return shopHotelRoomTypeMapper.deleteShopHotelRoomTypeByIds(ids);
    }

    /**
     * 删除酒店房间类型信息
     * 
     * @param id 酒店房间类型主键
     * @return 结果
     */
    @Override
    public int deleteShopHotelRoomTypeById(Long id)
    {
        return shopHotelRoomTypeMapper.deleteShopHotelRoomTypeById(id);
    }
}
